package com.wt.admin.controller.image;


import com.aizuda.easy.security.domain.Rep;
import com.aizuda.easy.security.domain.Req;
import com.wt.admin.config.aspect.annotation.LogAno;
import com.wt.admin.domain.dto.image.ImageFeaturesDTO;
import com.wt.admin.domain.vo.image.ImageFeaturesListVO;
import com.wt.admin.domain.vo.image.ImageFeaturesVO;
import com.wt.admin.domain.vo.sys.UserVO;
import com.wt.admin.service.image.ImageProxyService;
import com.wt.admin.util.PageUtil;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;

@RestController
@RequestMapping("imageFeatures")
public class ImageFeaturesController {

    @Resource
    private ImageProxyService imageProxyService;

    @LogAno(name = "添加特征")
    @PostMapping("add")
    public Rep<ImageFeaturesVO> add(@RequestBody Req<ImageFeaturesDTO, UserVO> req){
        return Rep.ok(imageProxyService.getImageFeaturesService().add(req.getData()));
    }

    @LogAno(name = "特征列表")
    @PostMapping("list")
    public Rep<ImageFeaturesListVO> list(@RequestBody Req<PageUtil.PageDTO<ImageFeaturesDTO>, UserVO> req){
        return Rep.ok(imageProxyService.featuresList(req.getData()));
    }

    @LogAno(name = "删除特征")
    @PostMapping("del")
    public Rep<ImageFeaturesVO> del(@RequestBody Req<ImageFeaturesDTO, UserVO> req){
        return Rep.ok(imageProxyService.featuresDel(req.getData()));
    }

    @LogAno(name = "编辑特征")
    @PostMapping("edit")
    public Rep<ImageFeaturesVO> edit(@RequestBody Req<ImageFeaturesDTO, UserVO> req){
        return Rep.ok(imageProxyService.featuresEdit(req.getData()));
    }

}
